package com.kaifamiao.enums;

import java.util.Arrays;

public class SunTest {

	public static void main(String[] args) {
		
		Sun s = Sun.SINGLETON ; 
		System.out.println( s.toString() );
		System.out.println( System.identityHashCode( s ) );
		
		// 调用类方法 valueOf 根据枚举常量名称获得指定的枚举常量
		Sun u = Sun.valueOf( "SINGLETON" );
		System.out.println( s == u );
		
		// 获得Sun类中所有的枚举常量
		Sun[] array = Sun.values();
		System.out.println( Arrays.toString( array ) );

	}

}
